#include <stdio.h>
#include <ctype.h>
#include <stddef.h>
#include <stdbool.h>

bool isIsogram(const char phrase[]) {
    if (phrase == NULL) {
        return false;
    }
    
    int occurrences[26] = {0};  // Array to track occurrences of each letter

    for (int i = 0; phrase[i] != '\0'; i++) {
        if (!isalpha(phrase[i])) {
            continue;  // Skip non-alphabetic characters
        }
        
        int index = tolower(phrase[i]) - 'a';

        if (occurrences[index] > 0) {
            return false;  // Letter has already occurred in the string
        }

        occurrences[index]++;
    }
    return true;  // No repeated letters found
}

int main() {
    char input[100];
    printf("Enter a string: ");
    int result = scanf("%s", input);
    if (result) {
        if (isIsogram(input)) {
        printf("%s is an isogram.\n", input);
    } else {
        printf("%s is not an isogram.\n", input);
    }
    } else {
        printf("Error reading string!\n");
    }
    return 0;
}

